<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var rg =/123/;
    //test方法 用来检测是否满足正则的规范
    console.log(rg.test(123));
    console.log(rg.test('aaa'));
  </script>
</body>
</html>